<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="language" content="en" />
    <meta name="author" content="MrDan" />

    <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->theme->baseUrl; ?>/css/style.css" />
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->theme->baseUrl; ?>/css/form.css" />

	<title><?php echo CHtml::encode($this->pageTitle); ?></title>
</head>

<body>

<div id="container" class="fixed">
<div id="header" class="border-line">
    <div id="logo" title="D&D PHP Group"></div>
    <div id="slogan" title="D&D PHP Group">D&D PHP Group</div>
    <div id="panel-button">
<?php
	if(Yii::app()->user->isGuest):
?>
<?php	echo CHtml::button('Login', array('submit' => array('site/loginregister')));?>
<?php	echo CHtml::button('Register', array('submit' => array('site/loginregister')));?>
<?php
	else:
?>
<?php	echo CHtml::button('Hello .:: '.Yii::app()->user->name.' ::.', array('submit' => array('users/viewprofiles', 'id'=>Yii::app()->user->id)));?>
<?php	echo CHtml::button('LogOut', array('submit' => array('site/logout')));?>
<?php
	endif;
?>
    </div>
    <div class="clear"></div>
    <div id="mainmenu">
        <?php $this->widget('zii.widgets.CMenu',array(
			'items'=>array(
				array('label'=>'Home', 'url'=>array('/site')),
				array('label'=>'Events', 'url'=>array('/event')),
				array('label'=>'Create Event', 'url'=>array('/event/create')),
				array('label'=>'Contact', 'url'=>array('/site/contact')),
			),
		)); ?>
    </div>
    
    <?php $this->widget('zii.widgets.CBreadcrumbs', array(
		'links'=>$this->breadcrumbs,
	)); ?>
</div>
	<?php $this->renderPartial('//site/dialog'); ?>
    <?php echo $content; ?>
    
<div id="footer">
    <div id="footer-title" class="border-line">
    
    </div>
    <div id="footer-content" class="border-line">
        <div class="footer-box">
            <span>Events</span>
            <?php $this->widget('zii.widgets.CMenu',array(
    			'items'=>array(
    				array('label'=>'New Events', 'url'=>array('/event/')),
    				array('label'=>'Top Events', 'url'=>array('/event/topevents')),
    				array('label'=>'Hot Events', 'url'=>array('/event/hotevents')),
                    array('label'=>'All Events', 'url'=>array('/event')),
    			),
    		)); ?>
        </div>
        
        <div class="footer-box">
            <span>Account</span>
            <?php $this->widget('zii.widgets.CMenu',array(
    			'items'=>array(
                    array('label'=>'Persional Informations', 'url'=>array('users/viewprofiles', 'id'=>Yii::app()->user->id), 'visible'=>!Yii::app()->user->isGuest),
    				array('label'=>'Login or Register', 'url'=>array('/site/loginregister'), 'visible'=>Yii::app()->user->isGuest),
    				array('label'=>'Logout ('.Yii::app()->user->name.')', 'url'=>array('/site/logout'), 'visible'=>!Yii::app()->user->isGuest)
    			),
    		)); ?>
            <span>Tools</span>
            <?php $this->widget('zii.widgets.CMenu',array(
    			'items'=>array(
                    array('label'=>'You must Logged in to Use Tools', 'url'=>array('/site/loginregister'), 'visible'=>Yii::app()->user->isGuest),
    				array('label'=>'Create Event', 'url'=>array('/event/create'), 'visible'=>!Yii::app()->user->isGuest),
    				array('label'=>'My Events', 'url'=>array('/event/myevents'), 'visible'=>!Yii::app()->user->isGuest),
    				array('label'=>'My Favorite Events', 'url'=>array('/event'), 'visible'=>!Yii::app()->user->isGuest),
    			),
    		)); ?>
        </div>
        
        <div class="footer-box">
<?php
if(Yii::app()->user->name!='admin')
{ ?>
            <span>About Us</span>
            <ul>
                <li><a href="">MrDan</a></li>
                <li><a href="">Dung Than</a></li>
            </ul>
            
            <span>Project: Events</span>
            <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Special Thanks To:</p>
            <ul>
                <li><a href="">MrDan</a></li>
                <li><a href="">Dung Than</a></li>
            </ul>
<?php
}
else
{
?>
            <span>Manager Users</span>
<?php
            $this->widget('zii.widgets.CMenu',array(
    			'items'=>array(
    				array('label'=>'Danh  sach nguoi dung', 'url'=>array('/users/index'), 'visible'=>!Yii::app()->user->isGuest),
                	array('label'=>'Manage Users', 'url'=>array('/users/admin')),
    			),
    		));
} ?>
        </div>
        
    </div>
	<div class="clear"></div>
</div>
<div id="footer-copyright">
    Copyright &copy; D&D Group - Event Project
</div>
</div>
</body>
</html>